From: Lars Magne Ingebrigtsen Date: Sat, 25 Feb 2012 13:20:57 +0000 (+0000) Subject: shr.el (shr-column-specs): Protect against TDs with "width: 0%". X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~618 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=9909bf032af6c7c008157b128c919bc8e5f0b92c;p=emacs.git shr.el (shr-column-specs): Protect against TDs with "width: 0%". --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 3445b10d81b..c5053a660d8 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,7 @@ +2012-02-25 Lars Magne Ingebrigtsen + + * shr.el (shr-column-specs): Protect against TDs with "width: 0%". + 2012-02-23 Katsumi Yamaoka * nntp.el (nntp-send-authinfo): Work for secure nntp entry in authinfo. diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index dd0f1599c36..41f12243971 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el @@ -1364,10 +1364,10 @@ ones, in case fg and bg are nil." (when (memq (car column) '(td th)) (let ((width (cdr (assq :width (cdr column))))) (when (and width - (string-match "\\([0-9]+\\)%" width)) - (aset columns i - (/ (string-to-number (match-string 1 width)) - 100.0)))) + (string-match "\\([0-9]+\\)%" width) + (not (zerop (setq width (string-to-number + (match-string 1 width)))))) + (aset columns i (/ width 100.0)))) (setq i (1+ i))))))) columns))